package com.snowflake.ecatalog.repository;

import java.util.Collection;
import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.snowflake.ecatalog.entity.CompanyCategoryStandard;

/**
 * 企业分类标准
 */
public interface CompanyCategoryStandardDao extends PagingAndSortingRepository<CompanyCategoryStandard, Long>,
		JpaSpecificationExecutor<CompanyCategoryStandard> {
	@Modifying
	@Query("update CompanyCategoryStandard ccs set ccs.status = ?1 where ccs.id=?2")
	void changeStatus(Integer status, Long id);

	List<CompanyCategoryStandard> findByStatus(int status);

	List<CompanyCategoryStandard> findByStatusAndIdNotIn(int status, Collection<Long> exludeIdList);
}
